home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Dreaddir(2) Oct. 1, 1991 Dreaddir(2)
-
-
- N✓NA✓AM✓ME✓E
- Dreaddir - read directory information
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- LONG Dreaddir( WORD len, LONG dirhandle, char *buf);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- _✓r_✓e_✓a_✓d_✓d_✓i_✓r returns the next file in the directory whose han-
- dle (from the _✓D_✓o_✓p_✓e_✓n_✓d_✓i_✓r system call) is _✓d_✓i_✓r_✓h_✓a_✓n_✓d_✓l_✓e. The
- file's name and (optionally) a 4 byte index for the file
- are placed in the buffer pointed to by _✓b_✓u_✓f. The file
- index is omitted if the directory was opened in "compati-
- bility" mode (see _✓D_✓o_✓p_✓e_✓n_✓d_✓i_✓r(2) for details); otherwise, it
- is placed first in the buffer, followed by the (null ter-
- minated) name. If two names have the same index, then they
- refer to the same file; the converse, however, is not
- true.
-
- _✓l_✓e_✓n is the size of the buffer, in total; it should be
- large enough to hold the index (if any), the file name,
- and the trailing 0.
-
- Successive calls to _✓D_✓r_✓e_✓a_✓d_✓d_✓i_✓r will return all the names in
- the directory, one after another, unless the _✓D_✓r_✓e_✓w_✓i_✓n_✓d_✓d_✓i_✓r
- system call is used to restart the reading at the begin-
- ning of the directory.
-
- R✓RE✓ET✓TU✓UR✓RN✓NS✓S
- 0 if successful
-
- ERANGE if the buffer was not large enough to hold the
- index (if present) and name
-
- ENMFIL if there are no more file names to be read from the
- directory
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- _✓D_✓c_✓l_✓o_✓s_✓e_✓d_✓i_✓r(2), _✓D_✓o_✓p_✓e_✓n_✓d_✓i_✓r(2) _✓D_✓r_✓e_✓w_✓i_✓n_✓d_✓d_✓i_✓r(2)
-
- B✓BU✓UG✓GS✓S
- Failure to call Dclosedir() when the search is done could
- result in the system eventually running out of file
- indices; this is fatal. So always call Dclosedir() when
- you're finished with the directory search!
-
-
-
-
-
-
-
-
-
-
-
-
-
- Version 0.9 MiNT Programmer's Manual 1
-
-
-